<div class="header">
    <div class="wrapper">
        <div class='logo fl'>
            <img style="margin-top: 4px;" src="{$config.web_logo|default='/res/img/logo.png'}" alt="logo">
        </div>
        <div class='nav fl'>
            <ul class='nav_ul'>
                {php}
                    $nid=input('nid');
                    if(empty($nid)){
                        $current_class="active";
                    }
                {/php}
                <li class="{$current_class|default=''}"><a href="/index.php" target="_self">首页</a></li>
                {xto:select dao='\app\web\dao\NavDao' where="" order="nav_order asc" id="vo" limit="999" name="list"}
                    {if condition='$vo.pid==0 && $vo.is_view==1'}
                        {php}
                            $class='';
                            foreach($list as $item){
                                if($item['pid']==$vo['nid']){
                                    $class='dropdown';
                                    break;
                                }
                            }
                            if($nid==$vo['nid']){
                                $class=$class.' active';
                            }
                            $c=$vo['controller'];
                            $a=$vo['type'];
                            $nid=$vo['nid'];
                            $link="?s=/web/$c/$a&nid=$nid";
                            if(!empty($vo['url'])){
                                $link=$vo['url'];
                            }
                        {/php}
                        <li class="{$class}" ><a href="{$link}" target="_self">{$vo.title}</a>
                            <ul class="fun_center" >
                            {volist name="list" id="sub"}
                                {if condition='$sub.pid==$vo.nid && $sub.is_view==1'}
                                {php}
                                    $c=$sub['controller'];
                                    $a=$sub['type'];
                                    $nid=$sub['nid'];
                                    $link="?s=/web/$c/$a&nid=$nid";
                                    if(!empty($sub['url'])){
                                        $link=$sub['url'];
                                    }
                                {/php}
                                <li><a href="{$link}" target="_self" ><span>{$sub.title}</span></a></li>
                                {/if}
                            {/volist}
                            </ul>
                        </li>
                    {/if}
                {/xto:select}
            </ul>
        </div>
        <div style="clear:both"></div>
    </div>
</div>